<?php


namespace App\Twig;

use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

class ArrayIntersectExtension extends AbstractExtension {
    public function getFunctions () {
        return [
            new TwigFunction('array_intersect', [$this, 'doArrayIntersect']),
        ];
    }

    public function doArrayIntersect ($arr1, $arr2) {
        return array_intersect($arr1, $arr2);
    }
}